package Thread.New.带返回值的线程创建;

import java.util.concurrent.Callable;

public class CallableImpl implements Callable<String> {
    private String name;
    public CallableImpl (String name){
        this.name = name;
    }

    @Override
    public String call() throws Exception {
        System.out.println(name+"开始执行线程任务");
        Thread.sleep(2000);
        //睡眠一s来看看执行效果
        System.out.println("线程任务执行完毕");
        return "执行了"+name;
    }
}
